package com.github.androiddevelopmentframework.mvp.activity;

import android.view.View;
import android.widget.TextView;

import com.github.androiddevelopmentframework.R;
import com.github.androiddevelopmentframework.mvp.baiduInterface.BaiduInterface;
import com.github.androiddevelopmentframework.mvp.presenter.BaiduPresenter;
import com.github.freewu.mvp.presenter.Presenter;
import com.github.freewu.mvp.view.BaseActivity;
import com.google.gson.JsonObject;

/**
 * Created by free on 16-10-18.
 */

public class BaiduActivity extends BaseActivity implements BaiduInterface.ViewInterface{
    private BaiduPresenter baiduPresenter;

    private TextView textView;

    @Override
    public int getLayout() {
        return R.layout.activity_baidu;
    }

    @Override
    public void initView(View mView) {
        textView=(TextView)mView.findViewById(R.id.textView);
    }

    @Override
    public void initData() {
        baiduPresenter=new BaiduPresenter(this);

        baiduPresenter.request();

        addPresenter(baiduPresenter);
    }

    @Override
    public void setText(String text) {
        textView.setText(text);
    }

    @Override
    public void OnReloadViewClick(View v) {
        super.OnReloadViewClick(v);

        baiduPresenter.request();
    }
}
